<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: EstadosTraineeController</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">EstadosTraineeController</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/app/controllers/estados_trainee_controller_rb.html">
                app/controllers/estados_trainee_controller.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="ApplicationController.html">
                ApplicationController
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000121">chequear_estado</a>&nbsp;&nbsp;
      <a href="#M000118">create</a>&nbsp;&nbsp;
      <a href="#M000120">destroy</a>&nbsp;&nbsp;
      <a href="#M000117">edit</a>&nbsp;&nbsp;
      <a href="#M000113">index</a>&nbsp;&nbsp;
      <a href="#M000116">new</a>&nbsp;&nbsp;
      <a href="#M000114">show</a>&nbsp;&nbsp;
      <a href="#M000115">show_all</a>&nbsp;&nbsp;
      <a href="#M000119">update</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000121" class="method-detail">
        <a name="M000121"></a>

        <div class="method-heading">
          <a href="#M000121" class="method-signature">
          <span class="method-name">chequear_estado</span><span class="method-args">(estado)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000121-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000121-source">
<pre>
     <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 103</span>
103:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">chequear_estado</span>(<span class="ruby-identifier">estado</span>)
104:                 <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Trainee</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>,<span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'estado_trainee_id = ?'</span>,<span class="ruby-identifier">estado</span>.<span class="ruby-identifier">id</span>])
105:                         <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
106:                 <span class="ruby-keyword kw">else</span>
107:                         <span class="ruby-keyword kw">if</span> <span class="ruby-constant">Ogxtrainee</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:first</span>,<span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> [<span class="ruby-value str">'estado_trainee_id = ?'</span>,<span class="ruby-identifier">estado</span>.<span class="ruby-identifier">id</span>])
108:                                 <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
109:                         <span class="ruby-keyword kw">end</span>                  
110:                 <span class="ruby-keyword kw">end</span>
111:                 <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
112:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000118" class="method-detail">
        <a name="M000118"></a>

        <div class="method-heading">
          <a href="#M000118" class="method-signature">
          <span class="method-name">create</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
POST /estados_trainee POST /estados_trainee.xml
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000118-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000118-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 54</span>
54:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>
55:         
56:         <span class="ruby-ivar">@estado_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:estado_trainee</span>])
57: 
58:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
59:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@estado_trainee</span>.<span class="ruby-identifier">save</span>
60:         <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-value str">'EstadoTrainee was successfully created.'</span>
61:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">redirect_back_or_default</span>(<span class="ruby-value str">'/estados_trainee'</span>) }
62:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@estado_trainee</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:created</span>, <span class="ruby-identifier">:location</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@estado_trainee</span> }
63:       <span class="ruby-keyword kw">else</span>
64:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;new&quot;</span> }
65:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@estado_trainee</span>.<span class="ruby-identifier">errors</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:unprocessable_entity</span> }
66:       <span class="ruby-keyword kw">end</span>
67:     <span class="ruby-keyword kw">end</span>
68:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000120" class="method-detail">
        <a name="M000120"></a>

        <div class="method-heading">
          <a href="#M000120" class="method-signature">
          <span class="method-name">destroy</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
DELETE /estados_trainee/1 DELETE /estados_trainee/1.xml
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000120-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000120-source">
<pre>
     <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 89</span>
 89:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">destroy</span>
 90:                 <span class="ruby-ivar">@estado_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
 91:                 
 92:                 <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">chequear_estado</span>(<span class="ruby-ivar">@estado_trainee</span>)
 93:                         <span class="ruby-ivar">@estado_trainee</span>.<span class="ruby-identifier">destroy</span>
 94:                         <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
 95:                         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">redirect_to</span>(<span class="ruby-identifier">estados_trainee_url</span>) }
 96:                         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">head</span> <span class="ruby-identifier">:ok</span> }
 97:                 <span class="ruby-keyword kw">end</span>        
 98:                 <span class="ruby-keyword kw">else</span>
 99:                         <span class="ruby-identifier">redirect_to</span> (<span class="ruby-identifier">estados_trainee_path</span>)
100:                 <span class="ruby-keyword kw">end</span>
101:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000117" class="method-detail">
        <a name="M000117"></a>

        <div class="method-heading">
          <a href="#M000117" class="method-signature">
          <span class="method-name">edit</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
GET /estados_trainee/1/edit
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000117-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000117-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 48</span>
48:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">edit</span>
49:     <span class="ruby-ivar">@estado_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
50:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000113" class="method-detail">
        <a name="M000113"></a>

        <div class="method-heading">
          <a href="#M000113" class="method-signature">
          <span class="method-name">index</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
GET /estados_trainee GET /estados_trainee.xml
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000113-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000113-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 8</span>
 8:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index</span>
 9:   
10:         <span class="ruby-ivar">@estados_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">search_all</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:search</span>],<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:page</span>])
11:     
12:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
13:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> <span class="ruby-comment cmt"># index.html.erb</span>
14:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@estados_trainee</span> }
15:     <span class="ruby-keyword kw">end</span>
16:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000116" class="method-detail">
        <a name="M000116"></a>

        <div class="method-heading">
          <a href="#M000116" class="method-signature">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
GET /estados_trainee/new GET /estados_trainee/new.xml
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000116-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000116-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 38</span>
38:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">new</span>
39:     <span class="ruby-ivar">@estado_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">new</span>
40: 
41:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
42:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> <span class="ruby-comment cmt"># new.html.erb</span>
43:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@estado_trainee</span> }
44:     <span class="ruby-keyword kw">end</span>
45:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000114" class="method-detail">
        <a name="M000114"></a>

        <div class="method-heading">
          <a href="#M000114" class="method-signature">
          <span class="method-name">show</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
GET /estados_trainee/1 GET /estados_trainee/1.xml
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000114-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000114-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 20</span>
20:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>
21:     <span class="ruby-ivar">@estado_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
22: 
23:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
24:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> <span class="ruby-comment cmt"># show.html.erb</span>
25:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@estado_trainee</span> }
26:     <span class="ruby-keyword kw">end</span>
27:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000115" class="method-detail">
        <a name="M000115"></a>

        <div class="method-heading">
          <a href="#M000115" class="method-signature">
          <span class="method-name">show_all</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000115-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000115-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 29</span>
29:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show_all</span>
30:           <span class="ruby-ivar">@estados_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>)
31:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
32:       <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> <span class="ruby-comment cmt"># show.html.erb</span>
33:     <span class="ruby-keyword kw">end</span>  
34:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000119" class="method-detail">
        <a name="M000119"></a>

        <div class="method-heading">
          <a href="#M000119" class="method-signature">
          <span class="method-name">update</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
PUT /estados_trainee/1 PUT /estados_trainee/1.xml
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000119-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000119-source">
<pre>
    <span class="ruby-comment cmt"># File app/controllers/estados_trainee_controller.rb, line 72</span>
72:   <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">update</span>
73:     <span class="ruby-ivar">@estado_trainee</span> = <span class="ruby-constant">EstadoTrainee</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:id</span>])
74: 
75:     <span class="ruby-identifier">respond_to</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">format</span><span class="ruby-operator">|</span>
76:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@estado_trainee</span>.<span class="ruby-identifier">update_attributes</span>(<span class="ruby-identifier">params</span>[<span class="ruby-identifier">:estado_trainee</span>])
77:         <span class="ruby-identifier">flash</span>[<span class="ruby-identifier">:notice</span>] = <span class="ruby-value str">'EstadoTrainee was successfully updated.'</span>
78:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">redirect_back_or_default</span>(<span class="ruby-value str">'/estados_trainee'</span>) }
79:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">head</span> <span class="ruby-identifier">:ok</span> }
80:       <span class="ruby-keyword kw">else</span>
81:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">html</span> { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;edit&quot;</span> }
82:         <span class="ruby-identifier">format</span>.<span class="ruby-identifier">xml</span>  { <span class="ruby-identifier">render</span> <span class="ruby-identifier">:xml</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@estado_trainee</span>.<span class="ruby-identifier">errors</span>, <span class="ruby-identifier">:status</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:unprocessable_entity</span> }
83:       <span class="ruby-keyword kw">end</span>
84:     <span class="ruby-keyword kw">end</span>
85:   <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>